The present invention relates to the preparation of character information for display in a computer system, and more particularly to dynamic selection of a font encoding scheme based on font availability.
A computer application that generates characters for display provides information to a character drawing routine specifying the character to be displayed and the font. Often the font will be selected in advance. The information specifying the character will typically include a numeric index identifying the character in accordance with a particular character encoding scheme specified by the current locale. For example, `A` might be represented as 65, `B` might be represented as 66 and so on.
The font will typically be specified by a font name. In an X Window system environment font naming is defined by the X Logical Font Description convention, known as XLFD.
"-adobe-symbol-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific"; PA1 "-b&h-lucida-bold-r-normal-sans-0-0-0-0-m-0-iso8859-5"; and PA1 "-bitstream-charter-bold-i-normal--0-0-0-0-p-0-iso8859-1".
The suffixes "adobe-fontspecific", "iso8859-1", and "iso8859-5" specify a font encoding scheme and a character set of a particular version of the font. The font encoding scheme is the mapping between character and numeric index for that particular font. When a character is to be displayed, the character drawing routine must convert the numeric index identifying the character to the relevant font glyph index.
The specification of the current locale determines the character encoding scheme which is the same as the font encoding scheme. Only fonts encoded accordingly may be used. A problem arises in that many fonts may not be available with the font encoding scheme required by the current locale.
For example, consider the Solaris.TM. operating system available from Sun Microsystems.TM. operating with a Polish language locale specification. This locale specifies the ISO8859-2 font encoding scheme. However, most Polish language fonts may not be available in a version incorporating the ISO8859-2 font encoding scheme. Instead, the fonts have been developed for other platforms that specify other encoding schemes.
A similar problem arises for a user operating a Microsoft Windows X11 server emulator. Because the X Window system requires a single font encoding scheme per locale, the user cannot take advantage of the full range of fonts available under MS Windows if the fonts are encoded using different encoding schemes.